<template>
	<view class="coupon" style="margin:0" v-if="param.coupon_list.length>0">
		<view class="coupon-title flex-y-center flex-x-center" v-if="!coupon_index">
			<view class="flex-y-center title">
				<image :src="__wxapp_img.coupon.coupon.url"></image>
				<text>专享优惠券</text>
			</view>
			<navigator class="flex-y-center" url="/pages/coupon-list/coupon-list">
				<form @submit="$emit('_formIdSubmit',$event)" reportSubmit="true">
					<button formType="submit" id="_formIdSubmit" class="_formIdSubmit">
						<text>更多</text>
						<image :src="__wxapp_img.dapp.jiantou_r.url"></image>
					</button>
				</form>
			</navigator>
		</view>
		<scroll-view scrollX="true" style="height: 162upx">
			<view class="coupon-list flex-row" :style="{color:param.color?param.color:'#fff'}">
				<view @tap="$emit('receive',$event)" class="coupon-one flex-grow-0" :data-index="item.id" v-for="item in param.coupon_list"
				 :key="item.id">
					<image :src="item.is_receive==0?param.bg:param.bg_1"></image>
					<view class="coupon-content flex-row">
						<view class="flex-grow-0 coupon-left">
							<view class="flex-x-center sub flex-y-center">
								<view class="flex-y-bottom" v-if="item.discount_type==2">
									<text style="font-size: 9pt;line-height:1">￥</text>
									<text style="font-size:15pt;line-height:0.8">{{item.sub_price}}
									</text>
								</view>
								<view class="flex-y-bottom" v-if="item.discount_type==1">
									<text style="font-size:22pt;line-height:0.8">{{item.discount}}
									</text>
									<text style="line-height:1">折</text>
								</view>
							</view>
							<view class="flex-x-center flex-y-center min">满{{item.min_price}}元可用</view>
						</view>
						<view class="flex-grow-1 coupon-right flex-x-center flex-y-center">{{item.receive_content}}</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>var myVue = {};
	export default {
		props: ['param','coupon_index','__wxapp_img','vm'],
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>
</style>
